Inside Macintosh: QuickTime

Previous | Chapter Top | Chapter Contents | Next

Determining Whether the Movie Toolbox Is Installed

Use the Gestalt Manager to determine whether the Movie Toolbox is present. (The Gestalt Manager is fully described in Inside Macintosh: Overview .)

To determine whether the Movie Toolbox is available, use the Gestalt selector gestaltQuickTime . This selector has a value of 'qtim' . If the Movie Toolbox is not installed, the Gestalt Manager returns an error.

For a description of how the version number is formatted, see the description of the numeric version part of the 'vers' resource in the chapter "Gestalt Manager" in Inside Macintosh: Overview .

The code in Listing 1 contains a function that demonstrates how your application can call the Gestalt Manager.

Listing 1 Using the Gestalt Manager with the Movie Toolbox

#include <GestaltEqu.h>
#include <Movies.h>

Boolean IsQuickTimeInstalled (void)
{
    short   error;
    long    result;
    
    error = Gestalt (gestaltQuickTime, &result);
    return (error == noErr);
}

void main (void)
{
    Boolean qtInstalled;
    .
    .
    .
    qtInstalled = IsQuickTimeInstalled ();
}

If you store movies inside your application document rather than just dealing with movie files, you must account for the possibility that a user's computer does not have QuickTime installed. If the Movie Toolbox is not available on a computer, your application can display a still-image representation of a movie in place of the movie itself. For example, you can store a PICT image from the movie in the document file, in addition to the movie itself. Your application can then display that image whenever the Movie Toolbox is unavailable. If the user tries to play the movie, you should inform the user that your application cannot play the movie by displaying an alert box like the one shown in Figure 25 .

Figure 25 An alert box that tells the user that QuickTime is unavailable


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next